import { post, get } from '@utils/fetch'

// wiki https://gitee.com/gazhiwo/event/wikis/%E5%9F%BA%E7%A1%80%E4%BF%A1%E6%81%AF?sort_id=4429008
interface HolidayParams {
  innerCode: string
  event: string
}
// 获取节假日列表
export const getHolidayList = (): Promise<any> => get('/stock/base/event/list')

// 指数查询
export const getCodeList = (): Promise<any> => get('/stock/base/index/list')

// 获取具体某个节假日的某个指数历史数据
export const getHolidayListData = (params: HolidayParams): Promise<any> => post('/stock/event/history/increase', params)

// 某个指数在某个节假日的趋势(已废弃)
// export const getCodeListData = (params: HolidayParams): Promise<any> => post('/stock/event/history/trend', params)

// 历史综合数据List
export const getHistoryData = (params: { event:string }): Promise<any> => post('/stock/event/history/integrated', params)

// 当前能查询的范围
export const getRangeOptions = (): Promise<any> => get('/stock/base/section/list')

// 区间涨跌分析
export const getRangeData = (params: { innerCode: string, event: string, startCycle: string}): Promise<any> => post('/stock/event/history/section', params)

// 折线图数据v2
export const getTreadData = (params: HolidayParams): Promise<any> => post('/stock/event/history/trend', params)
